package com.ronghuanet.gift.client;

import com.ronghuanet.gift.dto.RegisterPhoneValidateDto;
import com.ronghuanet.gift.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class SmsValidateCodeClientFallbackFactory implements FallbackFactory<SmsValidateCodeClient> {
    @Override
    public SmsValidateCodeClient create(Throwable throwable) {
        return new SmsValidateCodeClient() {
            @Override
            public AjaxResult sendRegisterCode(String phone) {
                throwable.printStackTrace();
                return null;
            }

            @Override
            public AjaxResult validateRegisterCode(RegisterPhoneValidateDto dto) {
                throwable.printStackTrace();
                return null;
            }

        };
    }
}
